<template>
  <div>
    <div>
      <div v-for="item in questionList">
        <div><span>{{ item.title }}</span></div>
        <el-divider content-position="right">item.create_time</el-divider>
      </div>
    </div>
  </div>
</template>

<script>
import QuestionService from "@/service/QuestionService";
import DefaultMessageHandler from "@/utils/DefaultMessageHandler";

export default {
  name: 'Question',
  data () {
    return {
      questionList: [],
      page: 1,
      key: ''
    }
  },
  methods: {
    /**
     * 加载数据.
     * @param reload
     */
    loadData (reload) {
      if (reload) {
        this.page = 1
      }
      QuestionService.getList(this.key, this.page, (data) => {
        console.log('load data list: ', data)
      }, (fail) => {
        DefaultMessageHandler.error(fail, this)
      })
    }
  },
  mounted() {
    this.loadData(true)
  }
}
</script>

<style scoped>

</style>